﻿@using GdHotel.Data.Resources
@using GdHotel.Web.Models
@model NewsModel

@{
    ViewBag.Title = @Localization.News;
}

@section gallery{
    @if (Model != null && Model.Gallery != null)
    {
        <text>@Html.Partial("_ShowGallery", Model.Gallery)</text>
    }
}

<div class="wrap">

					<!--content-->
					<div class="content">
						<!--in_content-->
						<div class="in_content down clearfix">
							<!--block-->
							<div class="block">
								<h1>@Localization.News</h1>
								<div class="in_block">

									<ul class="news_list">
                                        @foreach (var pieceOfNews in Model.News)
                                        {
                                            var link = Url.Action("Show", new {id = pieceOfNews.Id});
                                            <li>
                                                @if (!String.IsNullOrEmpty(pieceOfNews.ThumbnailPath))
                                                {
                                                    <div class="news_photo">
                                                        <div class="shadow">
                                                            <div class="photo_wrap"><a href="@link"><img src="@Url.Content(pieceOfNews.ThumbnailPath)" width="124px" height="91px" alt="" /></a></div>
                                                        </div>
                                                    </div>
                                                }
                                                <p class="news_date">@pieceOfNews.PublicationDate.ToString("dd MMMM yyyy")</p>

                                                <h4><a href="@link">@pieceOfNews.Title</a></h4>
                                                <p>@pieceOfNews.ShortText</p>
                                            </li>
                                        }
									</ul>
									@*<p class="more"><a href="#">Архив новостей</a></p>*@
								</div>
							</div>
							<!--/block-->							
						</div>

						<!--/in_content-->
					</div>
					<!--/content-->					
					<!--sidebar-->
					<div class="sidebar">
						<!--in_sidebar-->
						<div class="in_sidebar down clearfix">	
							<ul class="promo_list">
                                @foreach (var relation in Model.SideBlocks)
                                {
                                    @Html.Partial("_SideBlockPartial", relation.SideBlock)
                                }
							</ul>
						</div>
						<!--/in_sidebar-->
					</div>
					<!--/sidebar-->
				</div>
